<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>第15章：swiper与地图插件 | MarkDown的使用</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../CSS/css_16.html" />
    
    
    <link rel="prev" href="../CSS/css_14.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2.15"
        data-chapter-title="第15章：swiper与地图插件"
        data-filepath="CSS/css_15.md"
        data-basepath=".."
        data-revision="Sat Dec 01 2018 16:27:07 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="HTML/html_int.html">
            
                
                    <a href="../HTML/html_int.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML5简介
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="HTML/gitbook_use.html">
            
                
                    <a href="../HTML/gitbook_use.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        第0章：gitbook的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="HTML/lesson1.html">
            
                
                    <a href="../HTML/lesson1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        第1章：常用标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="HTML/lesson2.html">
            
                
                    <a href="../HTML/lesson2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        第2章：列表与图片
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="HTML/lesson3.html">
            
                
                    <a href="../HTML/lesson3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        第3章：表格与表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="HTML/lesson4.html">
            
                
                    <a href="../HTML/lesson4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        第4章：实体字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="HTML/lesson5.html">
            
                
                    <a href="../HTML/lesson5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        第5章：多媒体和iframe
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="CSS/css_int.html">
            
                
                    <a href="../CSS/css_int.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        CSS简介
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="CSS/css_1.html">
            
                
                    <a href="../CSS/css_1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        第1章：引入css
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="CSS/css_2.html">
            
                
                    <a href="../CSS/css_2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        第2章：选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="CSS/css_3.html">
            
                
                    <a href="../CSS/css_3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        第3章：属性选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="CSS/css_4.html">
            
                
                    <a href="../CSS/css_4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        第4章：伪类选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="CSS/css_5.html">
            
                
                    <a href="../CSS/css_5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        第5章：盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="CSS/css_6.html">
            
                
                    <a href="../CSS/css_6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        第6章：伪对象选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="CSS/css_7.html">
            
                
                    <a href="../CSS/css_7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        第7章：font字体与边框
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="CSS/css_8.html">
            
                
                    <a href="../CSS/css_8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        第8章：行高
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="CSS/css_9.html">
            
                
                    <a href="../CSS/css_9.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        第9章：文字与背景
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="CSS/css_10.html">
            
                
                    <a href="../CSS/css_10.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        第10章：浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="CSS/css_11.html">
            
                
                    <a href="../CSS/css_11.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        第11章：定位与渐变
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="CSS/css_12.html">
            
                
                    <a href="../CSS/css_12.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        第12章：css过渡与变形
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="CSS/css_13.html">
            
                
                    <a href="../CSS/css_13.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        第13章：css动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14" data-path="CSS/css_14.html">
            
                
                    <a href="../CSS/css_14.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.</b>
                        
                        第14章：css滤镜
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.15" data-path="CSS/css_15.html">
            
                
                    <a href="../CSS/css_15.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.</b>
                        
                        第15章：swiper与地图插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.16" data-path="CSS/css_16.html">
            
                
                    <a href="../CSS/css_16.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.16.</b>
                        
                        第16章：移动端rem布局
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.17" data-path="CSS/css_17.html">
            
                
                    <a href="../CSS/css_17.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.17.</b>
                        
                        第17章：伸缩盒子
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="SASS/sass_int.html">
            
                
                    <a href="../SASS/sass_int.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        sass简介
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="SASS/sass_1.html">
            
                
                    <a href="../SASS/sass_1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        第1章：sass安装与使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="SASS/sass_2.html">
            
                
                    <a href="../SASS/sass_2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        第2章：sass语法入门
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="Bootstrap/Bootstrap_int.html">
            
                
                    <a href="../Bootstrap/Bootstrap_int.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        Bootstrap简介
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="Bootstrap/Bootstrap_1.html">
            
                
                    <a href="../Bootstrap/Bootstrap_1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        第1章：Bootstrap
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="JavaScript/JavaScript_int.html">
            
                
                    <a href="../JavaScript/JavaScript_int.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        JavaScript简介
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="JavaScript/JavaScript_1.html">
            
                
                    <a href="../JavaScript/JavaScript_1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        第1章：JavaScript
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="JavaScript/JavaScript_2.html">
            
                
                    <a href="../JavaScript/JavaScript_2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        第2章：变量
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="JavaScript/JavaScript_3.html">
            
                
                    <a href="../JavaScript/JavaScript_3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        第3章：Number
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="JavaScript/JavaScript_4.html">
            
                
                    <a href="../JavaScript/JavaScript_4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        第4章：数据类型判断
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="JavaScript/JavaScript_5.html">
            
                
                    <a href="../JavaScript/JavaScript_5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        第5章：运算符与字符串
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="JavaScript/JavaScript_6.html">
            
                
                    <a href="../JavaScript/JavaScript_6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        第6章：循环与流程控制
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="JavaScript/JavaScript_7.html">
            
                
                    <a href="../JavaScript/JavaScript_7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        第7章：函数与作用域
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" data-path="JavaScript/JavaScript_8.html">
            
                
                    <a href="../JavaScript/JavaScript_8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.</b>
                        
                        第8章：String方法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="JavaScript/JavaScript_9.html">
            
                
                    <a href="../JavaScript/JavaScript_9.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        第9章：数组方法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.10" data-path="JavaScript/JavaScript_10.html">
            
                
                    <a href="../JavaScript/JavaScript_10.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.10.</b>
                        
                        第10章：定时器与排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.11" data-path="JavaScript/JavaScript_11.html">
            
                
                    <a href="../JavaScript/JavaScript_11.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.11.</b>
                        
                        第11章：Date与Math
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.12" data-path="JavaScript/JavaScript_12.html">
            
                
                    <a href="../JavaScript/JavaScript_12.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.12.</b>
                        
                        第12章：简单的DOM操作与垃圾回收
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.13" data-path="JavaScript/JavaScript_13.html">
            
                
                    <a href="../JavaScript/JavaScript_13.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.13.</b>
                        
                        第13章：DOM操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.14" data-path="JavaScript/JavaScript_14.html">
            
                
                    <a href="../JavaScript/JavaScript_14.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.14.</b>
                        
                        第14章：DOM修改样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.15" data-path="JavaScript/JavaScript_15.html">
            
                
                    <a href="../JavaScript/JavaScript_15.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.15.</b>
                        
                        第15章：DOM常用标签属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.16" data-path="JavaScript/JavaScript_16.html">
            
                
                    <a href="../JavaScript/JavaScript_16.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.16.</b>
                        
                        第16章：鼠标坐标与拖拽
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.17" data-path="JavaScript/JavaScript_17.html">
            
                
                    <a href="../JavaScript/JavaScript_17.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.17.</b>
                        
                        第17章：滚动条
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.18" data-path="JavaScript/JavaScript_18.html">
            
                
                    <a href="../JavaScript/JavaScript_18.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.18.</b>
                        
                        第18章：事件冒泡与事件代理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.19" data-path="JavaScript/JavaScript_19.html">
            
                
                    <a href="../JavaScript/JavaScript_19.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.19.</b>
                        
                        第19章：原型对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.20" data-path="JavaScript/JavaScript_20.html">
            
                
                    <a href="../JavaScript/JavaScript_20.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.20.</b>
                        
                        第20章：this
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.21" data-path="JavaScript/JavaScript_21.html">
            
                
                    <a href="../JavaScript/JavaScript_21.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.21.</b>
                        
                        第21章：Ajax
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >MarkDown的使用</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="swiper&#x63D2;&#x4EF6;&#x548C;&#x9AD8;&#x5FB7;&#x5730;&#x56FE;&#x63D2;&#x4EF6;">swiper&#x63D2;&#x4EF6;&#x548C;&#x9AD8;&#x5FB7;&#x5730;&#x56FE;&#x63D2;&#x4EF6;</h1>
<h3 id="1swiper">1.swiper</h3>
<p>&#x767E;&#x5EA6;&#x641C;&#x7D22;swiper&#x4E2D;&#x6587;&#x7F51;&#xFF0C;&#x6253;&#x5F00;swiper4.x&#x4F7F;&#x7528;&#x6559;&#x7A0B;</p>
<p>1.&#x9996;&#x5148;&#x52A0;&#x8F7D;&#x63D2;&#x4EF6;&#xFF0C;&#x9700;&#x8981;&#x7528;&#x5230;&#x7684;&#x6587;&#x4EF6;&#x6709;swiper.min.js&#x548C;swiper.min.css&#x6587;&#x4EF6;&#x3002;&#x53EF;&#x4E0B;&#x8F7D;Swiper&#x6587;&#x4EF6;&#x6216;&#x4F7F;&#x7528;CDN&#x3002;</p>
<p>&#x5F15;&#x5165;css&#xFF08;&#x4F7F;&#x7528;cdn&#x7684;&#x65B9;&#x6CD5;&#xFF09;</p>
<pre><code>    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.2/css/swiper.css&quot; /&gt;
</code></pre><p>2.html&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-html">    <span class="hljs-comment">&lt;!-- &#x7ED3;&#x6784; --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;swiper-container&quot;</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;swiper-wrapper&quot;</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;swiper-slide&quot;</span> <span class="hljs-attribute">style</span>=<span class="hljs-value">&quot;background-color: skyblue;&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;swiper-slide&quot;</span> <span class="hljs-attribute">style</span>=<span class="hljs-value">&quot;background-color: orange;&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;swiper-slide&quot;</span> <span class="hljs-attribute">style</span>=<span class="hljs-value">&quot;background-color: blue;&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
        <span class="hljs-comment">&lt;!-- &#x5982;&#x679C;&#x9700;&#x8981;&#x5206;&#x9875;&#x5668; --&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;swiper-pagination&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>

        <span class="hljs-comment">&lt;!-- &#x5982;&#x679C;&#x9700;&#x8981;&#x5BFC;&#x822A;&#x6309;&#x94AE; --&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;swiper-button-prev&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">class</span>=<span class="hljs-value">&quot;swiper-button-next&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>

        <span class="hljs-comment">&lt;!-- &#x5982;&#x679C;&#x9700;&#x8981;&#x6EDA;&#x52A8;&#x6761; --&gt;</span>
        <span class="hljs-comment">&lt;!--&lt;div class=&quot;swiper-scrollbar&quot;&gt;&lt;/div&gt;--&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
    <span class="hljs-comment">&lt;!--&#x5BFC;&#x822A;&#x7B49;&#x7EC4;&#x4EF6;&#x53EF;&#x4EE5;&#x653E;&#x5728;container&#x4E4B;&#x5916;--&gt;</span>
</code></pre>
<p>3.&#x5728;&lt;/body&gt;&#x4E4B;&#x524D;&#x5F15;&#x5165;javascript&#x811A;&#x672C;&#xFF1A;</p>
<pre><code class="lang-javascript">    &lt;!-- &#x5F15;&#x5165;&#x811A;&#x672C; --&gt;
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-title">script</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">&quot;https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.2/js/swiper.js&quot;</span>&gt;</span><span class="undefined"></span><span class="hljs-tag">&lt;/<span class="hljs-title">script</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">script</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">&quot;text/javascript&quot;</span>&gt;</span><span class="actionscript">
        <span class="hljs-keyword">var</span> mySwiper = <span class="hljs-keyword">new</span> Swiper (<span class="hljs-string">&apos;.swiper-container&apos;</span>, {
            direction: <span class="hljs-string">&apos;horizontal&apos;</span>,     <span class="hljs-comment">// &#x5782;&#x76F4;&#x5207;&#x6362;&#x9009;&#x9879;</span>
            loop: <span class="hljs-literal">true</span>,                 <span class="hljs-comment">// &#x662F;&#x5426;&#x9700;&#x8981;&#x5FAA;&#x73AF;</span>
            autoplay:<span class="hljs-literal">true</span>,                <span class="hljs-comment">// &#x662F;&#x5426;&#x81EA;&#x52A8;&#x8F6E;&#x64AD;</span>

            <span class="hljs-comment">// &#x5982;&#x679C;&#x9700;&#x8981;&#x5206;&#x9875;&#x5668;</span>
            pagination: {
              el: <span class="hljs-string">&apos;.swiper-pagination&apos;</span>,
            },

            <span class="hljs-comment">// &#x5982;&#x679C;&#x9700;&#x8981;&#x524D;&#x8FDB;&#x540E;&#x9000;&#x6309;&#x94AE;</span>
            navigation: {
              nextEl: <span class="hljs-string">&apos;.swiper-button-next&apos;</span>,
              prevEl: <span class="hljs-string">&apos;.swiper-button-prev&apos;</span>,
            },

            <span class="hljs-comment">// &#x5982;&#x679C;&#x9700;&#x8981;&#x6EDA;&#x52A8;&#x6761;</span>
            scrollbar: {
              el: <span class="hljs-string">&apos;.swiper-scrollbar&apos;</span>,
            },
          })  
    </span><span class="hljs-tag">&lt;/<span class="hljs-title">script</span>&gt;</span>
</span></code></pre>
<ul>
<li><p>&#x5982;&#x679C;&#x8981;&#x4FEE;&#x6539;&#x6837;&#x5F0F;&#xFF0C;&#x9700;&#x8981;&#x4E0B;&#x8F7D;swiper.min.js&#x548C;swiper.min.css&#x5230;&#x672C;&#x5730;&#xFF0C;&#x518D;&#x8FDB;&#x884C;&#x4FEE;&#x6539;&#x5373;&#x53EF;</p>
</li>
<li><p>&#x5B98;&#x7F51;&#x8FD8;&#x6709;API&#x53EF;&#x4EE5;&#x67E5;&#x9605;</p>
</li>
</ul>
<h3 id="2&#x9AD8;&#x5FB7;&#x5730;&#x56FE;">2.&#x9AD8;&#x5FB7;&#x5730;&#x56FE;</h3>
<p>1.&#x9996;&#x5148;&#x767E;&#x5EA6;&#x641C;&#x7D22;&#xFF1A;&#x9AD8;&#x5FB7;&#x5730;&#x56FE;&#x5F00;&#x653E;&#x5E73;&#x53F0;|&#x9AD8;&#x5FB7;&#x5730;&#x56FE;API</p>
<p>2.&#x6CE8;&#x518C;&#x767B;&#x5F55;&#x540E;&#x521B;&#x5EFA;&#x65B0;&#x9879;&#x76EE;&#xFF0C;&#x83B7;&#x53D6;&#x5E76;&#x590D;&#x5236;Key&#xFF08;&#x5728;&#x5F15;&#x5165;js&#x7684;&#x94FE;&#x63A5;&#x4E2D;&#x7C98;&#x8D34;&#x5230;&#x5BF9;&#x5E94;&#x7684;&#x4F4D;&#x7F6E;&#xFF09;</p>
<p>3.html&#x4EE3;&#x7801;:</p>
<pre><code class="lang-html">
    <span class="hljs-tag">&lt;<span class="hljs-title">div</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">&quot;map&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-title">div</span>&gt;</span>
</code></pre>
<p>4.css&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code class="lang-css">    <span class="hljs-id">#map</span> <span class="hljs-rules">{
        <span class="hljs-rule"><span class="hljs-attribute">width</span>:<span class="hljs-value"><span class="hljs-number">1000px</span></span></span>; 
        <span class="hljs-rule"><span class="hljs-attribute">height</span>:<span class="hljs-value"> <span class="hljs-number">500px</span></span></span>; 
    }</span>
</code></pre>
<p>5.js&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code>    &lt;!-- &#x5F15;&#x5165;&#x5DE5;&#x5177;&#x5E93; --&gt;
    &lt;script src=&quot;https://webapi.amap.com/maps?v=1.4.10&amp;key=9ac7ccbad7bebf95ee3e1f9f3bb6ef0f&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
        // &#x4F20;&#x5165;&#x9875;&#x9762;&#x5BB9;&#x5668;
        var map = new AMap.Map(&quot;map&quot;,{
            zoom:18,

            // &#x5E7F;&#x5DDE;&#x6D25;&#x6EE8;&#x817E;&#x8DC3;&#x5927;&#x53A6;
            center:[113.327309,23.131942]      // &#x5730;&#x56FE;&#x4EE5;&#x67D0;&#x4E2A;&#x5750;&#x6807;&#x4E3A;&#x4E2D;&#x5FC3;
        });

        // &#x70B9;&#x6807;&#x8BB0;
        var marker1 = new AMap.Marker({
            postion:[113.321038,23.12483]
        })
        // &#x5F80;&#x5730;&#x56FE;&#x6DFB;&#x52A0;&#x6807;&#x8BB0;
        map.add(marker1);


        // &#x81EA;&#x5B9A;&#x4E49;&#x7A97;&#x4F53;
        var infoWindow = new AMap.InfoWindow({
            isCustom : false,                         // &#x662F;&#x5426;&#x4F7F;&#x7528;&#x81EA;&#x5B9A;&#x4E49;&#x7A97;&#x4F53;
            content : &quot;&lt;h1&gt;&#x5E7F;&#x5DDE;&#x6D25;&#x6EE8;&#x817E;&#x8DC3;&#x5927;&#x53A6;&lt;/h1&gt;&quot;,    // &#x5185;&#x5BB9;
            offset : new AMap.Pixel(16,-45),        // &#x504F;&#x79FB;
        })
        var onMapkerClick = function(e){
            infoWindow.open(map,e.target.getPosition());    // &#x6253;&#x5F00;&#x4FE1;&#x606F;&#x7A97;&#x4F53;
            //e.target&#x5C31;&#x662F;&#x88AB;&#x70B9;&#x51FB;&#x7684;Marker
        }
        marker1.on(&apos;click&apos;,onMapkerClick);            // &#x7ED1;&#x5B9A;click&#x4E8B;&#x4EF6;
    &lt;/script&gt;
</code></pre><ul>
<li>&#x9700;&#x8981;&#x66F4;&#x591A;&#x7684;&#x5C5E;&#x6027;&#x8BF7;&#x9605;&#x8BFB;&#x5B98;&#x7F51;&#x5F00;&#x53D1;&#x6587;&#x6863;</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../CSS/css_14.html" class="navigation navigation-prev " aria-label="Previous page: 第14章：css滤镜"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../CSS/css_16.html" class="navigation navigation-next " aria-label="Next page: 第16章：移动端rem布局"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
